package com.qf.boot1.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @author 刘欣
 * @createTime 2023/2/3 9:11
 * @description
 */
@Configuration
public class SwaggerConfiguration {

    @Bean
    public Docket buildDocket() {
        return new Docket(DocumentationType.SWAGGER_2).apiInfo(buildApiInfo()).select().apis(RequestHandlerSelectors.basePackage("com.qf.boot1.controller")).build();
    }

    public ApiInfo buildApiInfo() {
        Contact qfeducation = new Contact("QFEDUCATION", "https://m.baidu.com/", "13898722580@163.com");
        return new ApiInfoBuilder().contact(qfeducation).title("开放平台管理系统").version("0.0.1").description("开放平台管理系统接口文档").build();

    }
}
